<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.ico?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="CG,">










<meta name="description" content="材质模型在数学上由BSDF描述，BSDF主要由BRDF(Reflectance)和BTDF(Transmittance)组成。仅为Filament的文档笔记">
<meta name="keywords" content="CG">
<meta property="og:type" content="article">
<meta property="og:title" content="Material System in Filament : 材质模型">
<meta property="og:url" content="http://htelepathh.gitee.io/2022/04/23/Material-System-in-Filament-材质模型/index.html">
<meta property="og:site_name" content="OUTPUT">
<meta property="og:description" content="材质模型在数学上由BSDF描述，BSDF主要由BRDF(Reflectance)和BTDF(Transmittance)组成。仅为Filament的文档笔记">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/04/23/Material-System-in-Filament-材质模型/material_chart.jpg">
<meta property="og:updated_time" content="2022-05-04T07:33:17.021Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Material System in Filament : 材质模型">
<meta name="twitter:description" content="材质模型在数学上由BSDF描述，BSDF主要由BRDF(Reflectance)和BTDF(Transmittance)组成。仅为Filament的文档笔记">
<meta name="twitter:image" content="http://htelepathh.gitee.io/2022/04/23/Material-System-in-Filament-材质模型/material_chart.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://htelepathh.gitee.io/2022/04/23/Material-System-in-Filament-材质模型/">





  <title>Material System in Filament : 材质模型 | OUTPUT</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">OUTPUT</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">HTelepathH's blog</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://htelepathh.gitee.io/2022/04/23/Material-System-in-Filament-材质模型/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="HTelepathH">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/MOB.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="OUTPUT">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Material System in Filament : 材质模型</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2022-04-23T01:54:23+08:00">
                2022-04-23
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/material/" itemprop="url" rel="index">
                    <span itemprop="name">material</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>材质模型在数学上由BSDF描述，BSDF主要由BRDF(Reflectance)和BTDF(Transmittance)组成。仅为Filament的文档笔记<br><a id="more"></a></p>
<h2 id="Standard-model"><a href="#Standard-model" class="headerlink" title="Standard model"></a>Standard model</h2><p>在Filament标准模型中BTDF被省略或者近似，所以这里BRDF只能模仿reflective(镜面)，isotropic(各向同性)，dielectric(电介质)，conductive(导体)的表面。BRDF主要由两项构成，漫反射部分$f_d$和镜面反射部分$f_r$。使用微表面模型建模</p>
<script type="math/tex; mode=display">f_x(v,l)=\frac{1}{|n\cdot v||n\cdot l|}\int_{\Omega}D(m,\alpha)G(v,l,m)f_m(v,l,m)(v\cdot m)(l\cdot m)dm</script><ul>
<li>$D$是法向量分布函数(NDF)，对表面的粗糙度起主要作用，由粗糙度参数$\alpha$决定，主要有GGX，Beckmann，Blinn等，这里注意一下NDF的定义<script type="math/tex; mode=display">\int_{\Omega^+} D(\omega)(\omega\cdot n)dw=1</script></li>
<li>$G$是几何项，主要考虑visibility (or occlusion or shadow-masking)</li>
<li>$f_m$是微表面BRDF，是$f_d$和$f_r$的主要区别，下文详述</li>
</ul>
<p>dielectric(电介质)，conductive(导体)的表面主要由次表面反射区分(因为纯金属材质不会有次表面反射)，这意味着conductive(导体)的材质没有漫反射项。</p>
<h3 id="Specular-BRDF-Cook-Torrance-Approximation"><a href="#Specular-BRDF-Cook-Torrance-Approximation" class="headerlink" title="Specular BRDF : Cook-Torrance Approximation"></a>Specular BRDF : Cook-Torrance Approximation</h3><p>对于镜面反射部分，$f_m$是可以用Fresnel law建模的镜面BRDF，Cook-Torrance把微表面模型积分近似为</p>
<script type="math/tex; mode=display">f_r(v,l)=\frac{D(h,\alpha)G(v,l,\alpha)F(v,h,f_0)}{4(n\cdot v)(n\cdot l)}</script><ol>
<li><p><strong>NDF : GGX (Trowbridge-Reitz distribution)</strong></p>
<script type="math/tex; mode=display">D_{GGX}(h,\alpha)=\frac{\alpha^2}{\pi((n\cdot h)^2(\alpha^2-1)+1)^2}</script> <figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">D_GGX</span><span class="params">(<span class="keyword">float</span> NoH, <span class="keyword">float</span> roughness)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> a = NoH * roughness;</span><br><span class="line">    <span class="keyword">float</span> k = roughness / (<span class="number">1.0</span> - NoH * NoH + a * a);</span><br><span class="line">    <span class="keyword">return</span> k * k * (<span class="number">1.0</span> / PI);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>Geometric shadowing : Smith-GGX</strong></p>
<script type="math/tex; mode=display">G(v,l,\alpha)=G_1(l,\alpha)G_1(v,\alpha)</script><p> $G_1$一般使用GGX</p>
<script type="math/tex; mode=display">G_1(v,\alpha)=G_{GGX}(v,\alpha)=\frac{2(n\cdot v)}{n\cdot v+\sqrt{\alpha^2+(1-\alpha^2)(n\cdot v)^2}}</script><p> 重新定义$fr$</p>
<script type="math/tex; mode=display">f_r(v,l)=D(h,\alpha)V(v,l,\alpha)F(v,h,f_0)</script><script type="math/tex; mode=display">V(v,l,\alpha)=\frac{G(v,l,\alpha)}{4(n\cdot v)(n\cdot l)}</script><p> 使用<a href="https://google.github.io/filament/Filament.html#listing_specularv" target="_blank" rel="noopener">Height-correlated Smith function</a>后</p>
<script type="math/tex; mode=display">V(v,l,\alpha)=\frac{0.5}{n\cdot l(n\cdot v(1-\alpha)+\alpha)+n\cdot v(n\cdot l(1-\alpha)+\alpha)}</script><p> 还有[<a href="https://google.github.io/filament/Filament.html#listing_approximatedspecularv" target="_blank" rel="noopener">Hammon17</a>]的去掉根号的lerp版本</p>
 <figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">V_SmithGGXCorrelated</span><span class="params">(<span class="keyword">float</span> NoV, <span class="keyword">float</span> NoL, <span class="keyword">float</span> roughness)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> a2 = roughness * roughness;</span><br><span class="line">    <span class="keyword">float</span> GGXV = NoL * <span class="built_in">sqrt</span>(NoV * NoV * (<span class="number">1.0</span> - a2) + a2);</span><br><span class="line">    <span class="keyword">float</span> GGXL = NoV * <span class="built_in">sqrt</span>(NoL * NoL * (<span class="number">1.0</span> - a2) + a2);</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0.5</span> / (GGXV + GGXL);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>Fresnel : Schlick approximation</strong></p>
<script type="math/tex; mode=display">F_{Schlick}(v,h,f_0,f_{90})=f_0+(f_{90}-f_0)(1-v\cdot h)^5</script><p> 常数$f_0$表示法向入射时的镜面反射率，常数$f_{90}$表示掠射角的镜面反射率。$f_{90}$一般为1</p>
 <figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function">vec3 <span class="title">F_Schlick</span><span class="params">(<span class="keyword">float</span> u, vec3 f0, <span class="keyword">float</span> f90)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> f0 + (vec3(f90) - f0) * <span class="built_in">pow</span>(<span class="number">1.0</span> - u, <span class="number">5.0</span>);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ol>
<h3 id="Diffuse-BRDF"><a href="#Diffuse-BRDF" class="headerlink" title="Diffuse BRDF"></a>Diffuse BRDF</h3><p>对于漫反射部分，$f_m$是Lambertian函数</p>
<h4 id="Lambertian"><a href="#Lambertian" class="headerlink" title="Lambertian"></a>Lambertian</h4><p>假设在微平面半球上具有均匀的漫反射响应，积分则化简为</p>
<script type="math/tex; mode=display">f_d(v,l)=\frac{\sigma}{\pi}</script><h4 id="Disney"><a href="#Disney" class="headerlink" title="Disney"></a>Disney</h4><p>然而，理想情况下，漫反射部分应与镜面反射项保持一致，并考虑到表面粗糙度，Disney的[<a href="https://google.github.io/filament/Filament.html#listing_diffusebrdf" target="_blank" rel="noopener">Burley12</a>]$f_d$如下</p>
<script type="math/tex; mode=display">f_d(v,l)=\frac{\sigma}{\pi}F_{Schlick}(n,l,1,f_{90})F_{Schlick}(n,v,1,f_{90})</script><script type="math/tex; mode=display">f_{90}=0.5+2\cdot\alpha\cos^2(\theta_d),cos(\theta_d)=l\cdot h</script><h3 id="Energy-Loss"><a href="#Energy-Loss" class="headerlink" title="Energy Loss"></a>Energy Loss</h3><p>Cook-Torrance BRDF只建模了光的单次散射，显然这回造成roughness较高的情况下能量损失（单次散射ss被遮挡，多次散射ms后依然能够出射）。[<a href="https://google.github.io/filament/Filament.html#citation-kulla17" target="_blank" rel="noopener">Kulla17</a>]提出加入一个BRDF lobe作为补偿项$f_{ms}$。</p>
<script type="math/tex; mode=display">
f_{r}(l,v) = f_{ss}(l,v) + f_{ms}(l,v)</script><h4 id="Kulla-Conty"><a href="#Kulla-Conty" class="headerlink" title="Kulla-Conty"></a>Kulla-Conty</h4><p>[<a href="https://fpsunflower.github.io/ckulla/data/s2017_pbs_imageworks_slides_v2.pdf" target="_blank" rel="noopener">Kulla17</a>]提出的补偿项，其中包含了补偿directional albedo归一化和Fresnel 多次散射能量消耗。</p>
<script type="math/tex; mode=display">
f_{ms}(l,v) = \frac{(1 - E(l)) (1 - E(v)) F_{avg}^2 E_{avg}}{\pi (1 - E_{avg}) (1 - F_{avg}(1 - E_{avg}))}</script><p>$E$是specular BRDF ($f_0=1$)的directional albedo。$E_{avg}$是$E$的cosine-weighted average</p>
<script type="math/tex; mode=display">
E(l) = \int_{\Omega} f(l,v) (n\cdot v) dv\\
E_{avg} = 2 \int_0^1 E(\mu) \mu d\mu</script><p>其中$E(l)$依赖于$l,\alpha$。$E_{avg}$依赖于$\alpha$。都可以使用预计算查表。</p>
<p>$F_{avg}$是Fresnel的cosine-weighted average，可以用Schlick approximation</p>
<script type="math/tex; mode=display">
F_{avg} = 2 \int_0^1 F(\mu) \mu d\mu \approx \frac{1 + 20 f_0}{21}</script><h4 id="Lagarde"><a href="#Lagarde" class="headerlink" title="Lagarde"></a>Lagarde</h4><p>[<a href="https://google.github.io/filament/Filament.html#citation-lagarde18" target="_blank" rel="noopener">Lagarde18</a>]将Fresnel简化为$f_0$，并且把补偿项写作scaled GGX specluar lobe</p>
<script type="math/tex; mode=display">
f_{ms}(l,v) = f_0 \frac{1 - E(l)}{E(l)} f_{ss}(l,v)</script><p>因此整体表达式为</p>
<script type="math/tex; mode=display">
f_r(l,v) = f_{ss}(l,v) + f_0 \left( \frac{1}{r} - 1 \right) f_{ss}(l,v)\\
r = \int_{\Omega} D(l,v) V(l,v) \left< n\cdot l \right> dl</script><p>这样只需要存储r就可以<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line">vec3 energyCompensation = <span class="number">1.0</span> + f0 * (<span class="number">1.0</span> / dfg.y - <span class="number">1.0</span>);</span><br><span class="line"><span class="comment">// Scale the specular lobe to account for multiscattering</span></span><br><span class="line">Fr *= pixel.energyCompensation;</span><br></pre></td></tr></table></figure></p>
<h3 id="Summary"><a href="#Summary" class="headerlink" title="Summary"></a>Summary</h3><p>标准模型的代码如下<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">D_GGX</span><span class="params">(<span class="keyword">float</span> NoH, <span class="keyword">float</span> a)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> a2 = a * a;</span><br><span class="line">    <span class="keyword">float</span> f = (NoH * a2 - NoH) * NoH + <span class="number">1.0</span>;</span><br><span class="line">    <span class="keyword">return</span> a2 / (PI * f * f);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">vec3 <span class="title">F_Schlick</span><span class="params">(<span class="keyword">float</span> u, vec3 f0)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> f0 + (vec3(<span class="number">1.0</span>) - f0) * <span class="built_in">pow</span>(<span class="number">1.0</span> - u, <span class="number">5.0</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">V_SmithGGXCorrelated</span><span class="params">(<span class="keyword">float</span> NoV, <span class="keyword">float</span> NoL, <span class="keyword">float</span> a)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> a2 = a * a;</span><br><span class="line">    <span class="keyword">float</span> GGXL = NoV * <span class="built_in">sqrt</span>((-NoL * a2 + NoL) * NoL + a2);</span><br><span class="line">    <span class="keyword">float</span> GGXV = NoL * <span class="built_in">sqrt</span>((-NoV * a2 + NoV) * NoV + a2);</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0.5</span> / (GGXV + GGXL);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">Fd_Lambert</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">1.0</span> / PI;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">BRDF</span><span class="params">(...)</span> </span>&#123;</span><br><span class="line">    vec3 h = normalize(v + l);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">float</span> NoV = <span class="built_in">abs</span>(dot(n, v)) + <span class="number">1e-5</span>;</span><br><span class="line">    <span class="keyword">float</span> NoL = clamp(dot(n, l), <span class="number">0.0</span>, <span class="number">1.0</span>);</span><br><span class="line">    <span class="keyword">float</span> NoH = clamp(dot(n, h), <span class="number">0.0</span>, <span class="number">1.0</span>);</span><br><span class="line">    <span class="keyword">float</span> LoH = clamp(dot(l, h), <span class="number">0.0</span>, <span class="number">1.0</span>);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// perceptually linear roughness to roughness (see parameterization)</span></span><br><span class="line">    <span class="keyword">float</span> roughness = perceptualRoughness * perceptualRoughness;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">float</span> D = D_GGX(NoH, a);</span><br><span class="line">    vec3  F = F_Schlick(LoH, f0);</span><br><span class="line">    <span class="keyword">float</span> V = V_SmithGGXCorrelated(NoV, NoL, roughness);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// specular BRDF</span></span><br><span class="line">    vec3 Fr = (D * V) * F;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// diffuse BRDF</span></span><br><span class="line">    vec3 Fd = diffuseColor * Fd_Lambert();</span><br><span class="line"></span><br><span class="line">    <span class="comment">// apply lighting...</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="Parameterization"><a href="#Parameterization" class="headerlink" title="Parameterization"></a>Parameterization</h2><p>直接使用Disney principled的参数对于实时渲染来说比较复杂和冗余。Filament的标准参数和范围如下</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Definition</th>
<th>Type and range</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>BaseColor</strong></td>
<td><strong>Diffuse albedo</strong> for non-metallic surfaces, and <strong>specular color</strong> for metallic surfaces</td>
<td>Linear RGB [0..1]</td>
</tr>
<tr>
<td><strong>Metallic</strong></td>
<td>Whether a surface appears to be dielectric (0.0) or conductor (1.0). Often used as a <strong>binary value</strong> (0 or 1)</td>
<td>Scalar [0..1]</td>
</tr>
<tr>
<td><strong>Roughness</strong></td>
<td>Perceived smoothness (0.0) or roughness (1.0) of a surface. Smooth surfaces exhibit sharp reflections</td>
<td>Scalar [0..1]</td>
</tr>
<tr>
<td><strong>Reflectance</strong></td>
<td>Fresnel reflectance at normal incidence for dielectric surfaces. This replaces an explicit index of refraction</td>
<td>Scalar [0..1]</td>
</tr>
<tr>
<td><strong>Emissive</strong></td>
<td>Additional diffuse albedo to simulate emissive surfaces (such as neons, etc.) This parameter is mostly useful in an HDR pipeline with a bloom pass</td>
<td>Linear RGB [0..1] + exposure compensation</td>
</tr>
<tr>
<td><strong>Ambient occlusion</strong></td>
<td>Defines how much of the ambient light is accessible to a surface point. It is a per-pixel shadowing factor between 0.0 and 1.0. This parameter will be discussed in more details in the lighting section</td>
<td>Scalar [0..1]</td>
</tr>
</tbody>
</table>
</div>
<h3 id="remapping"><a href="#remapping" class="headerlink" title="remapping"></a>remapping</h3><p>为了让参数对艺术家们而言更直观，需要将<strong>baseColor</strong>,<strong>roughness</strong>,<strong>reflectance</strong>进行重映射</p>
<ul>
<li><strong>Base Color</strong><script type="math/tex; mode=display">diffuseColor = (1.0 - \textbf{metallic}) * \textbf{baseColor}</script><strong>baseColor</strong>受<strong>metallic</strong>影响。Dielectrics的镜面反射无色差，并保持以<strong>baseColor</strong>作为diffuse。Conductors使用<strong>baseColor</strong>作为镜面反射颜色，没有diffuse项</li>
<li><p><strong>Reflectance</strong></p>
<ul>
<li><p><strong>Dielectrics</strong></p>
<p>  Fresnel依赖于$f_0$，即法向入射角的镜面反射率，对于Dielectrics来说是消色差的。</p>
<script type="math/tex; mode=display">f_0=0.16*\textbf{reflectance}</script><p>  <a href="https://google.github.io/filament/Filament.html#figure_reflectance" target="_blank" rel="noopener">目标</a>是将$f_0$映射到可以表示常见电介质表面（4% 反射率）和宝石（8% 到 16%）的Fresnel值的范围内。 </p>
<p>  如果折射率(index of refraction,IOR)已知,$f_0$可以推导</p>
<script type="math/tex; mode=display">f_0(n_{IOR})=\frac{(n_{IOR}-1)^2}{(n_{IOR}+1)^2}</script><p>  <a href="https://google.github.io/filament/Filament.html#table_commonmatreflectance" target="_blank" rel="noopener">常见材质的Fresnel reflectance</a></p>
</li>
<li><p><strong>Conductors</strong><br>  导体的镜面反射有色差</p>
<script type="math/tex; mode=display">f_0=\textbf{baseColor}\cdot\textbf{metallic}</script><p>  <a href="https://google.github.io/filament/Filament.html#table_fnormalmetals" target="_blank" rel="noopener">常见金属材质的$f_0$</a></p>
<p>完整的$f_0$计算，用<strong>metallic</strong>进行”lerp”</p>
<figure class="highlight c"><table><tr><td class="code"><pre><span class="line">vec3 f0 = <span class="number">0.16</span> * reflectance * reflectance * (<span class="number">1.0</span> - metallic) </span><br><span class="line">      + baseColor * metallic;</span><br></pre></td></tr></table></figure>
</li>
</ul>
</li>
<li><p><strong>Roughness</strong></p>
<p>  为了让<strong>Roughness</strong>在视觉上符合linear的直觉</p>
<script type="math/tex; mode=display">\alpha=\textbf{roughness}^2</script></li>
</ul>
<h3 id="Crafting-Filament-PBM"><a href="#Crafting-Filament-PBM" class="headerlink" title="Crafting Filament PBM"></a>Crafting Filament PBM</h3><p>可以参照图表对于各个参数的设置</p>
<img src="/2022/04/23/Material-System-in-Filament-材质模型/material_chart.jpg" title="Physically-based Materials">
<h3 id="Clear-coat-model"><a href="#Clear-coat-model" class="headerlink" title="Clear coat model"></a>Clear coat model</h3><p>标准的材质模型师只建模了单层的各向同性表面，多层材质模型也很常见。Filament为了方便参数化， 清漆层永远是isotropic and dieletric(各向同性的电介质)</p>
<p>标准材质模型可以通过增加一个specular lobe的方式扩展到清漆材质模型。清漆层改变了DVF中的V(<a href="https://google.github.io/filament/Filament.html#listing_kelemen" target="_blank" rel="noopener">Kelemen visibility function</a>)</p>
<script type="math/tex; mode=display">V(l,h)=\frac{1}{4(l\cdot h)^2}</script><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">V_Kelemen</span><span class="params">(<span class="keyword">float</span> LoH)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0.25</span> / (LoH * LoH);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>对于清漆层中的Fresnel term，假设清漆为聚氨酯（PU），使用对应的IOR=1.5推导出$f_0=0.04$。最终的清漆模型BRDF为</p>
<script type="math/tex; mode=display">f(v,l)=(f_d(v,l)+f_r(v,l))(1-F_c)+f_c(v,l)</script><p>其中$F_c$是清漆BRDF中的Fresnel，$f_c$是清漆BRDF</p>
<p>清漆层的参数如下</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>ClearCoat</strong></td>
<td>Strength of the clear coat layer. Scalar [0…1]</td>
</tr>
<tr>
<td><strong>ClearCoatRoughness</strong></td>
<td>Perceived smoothness or roughness of the clear coat layer. Scalar [0…1]</td>
</tr>
</tbody>
</table>
</div>
<p>清漆模型的伪代码<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">BRDF</span><span class="params">(...)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// compute Fd and Fr from standard model</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">// remapping and linearization of clear coat roughness</span></span><br><span class="line">    clearCoatPerceptualRoughness = clamp(clearCoatPerceptualRoughness, <span class="number">0.089</span>, <span class="number">1.0</span>);</span><br><span class="line">    clearCoatRoughness = clearCoatPerceptualRoughness * clearCoatPerceptualRoughness;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// clear coat BRDF</span></span><br><span class="line">    <span class="keyword">float</span>  Dc = D_GGX(clearCoatRoughness, NoH);</span><br><span class="line">    <span class="keyword">float</span>  Vc = V_Kelemen(clearCoatRoughness, LoH);</span><br><span class="line">    <span class="keyword">float</span>  Fc = F_Schlick(<span class="number">0.04</span>, LoH) * clearCoat; <span class="comment">// clear coat strength</span></span><br><span class="line">    <span class="keyword">float</span> Frc = (Dc * Vc) * Fc;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// account for energy loss in the base layer</span></span><br><span class="line">    <span class="comment">// energyCompensation is Lagarde's IBL-based (can be Kulla-Conty)</span></span><br><span class="line">    <span class="comment">// Scale the specular lobe to account for multiscattering</span></span><br><span class="line">    <span class="keyword">return</span> color * ((Fd + Fr * energyCompensation) * (<span class="number">1.0</span> - Fc) + Frc);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>显然对于清漆模型基层中的$f_0$需要做一些修改，因为$f_0$的IOR是对空气的，现在要对于聚氨酯(IOR=1.5)</p>
<script type="math/tex; mode=display">f_{0}'=\frac{(1-5\sqrt{f_0})^2}{(5-\sqrt{f_0})^2}</script><h2 id="Anisotropic-model"><a href="#Anisotropic-model" class="headerlink" title="Anisotropic model"></a>Anisotropic model</h2><p>Disney使用了各向异性的GGX NDF来把标准模型扩展到各向异性</p>
<script type="math/tex; mode=display">D(h,\alpha)=\frac{1}{\pi\alpha_t\alpha_b}\frac{1}{((\frac{t\cdot h}{\alpha_t})^2+(\frac{b\cdot h}{\alpha_b})^2+(n\cdot h)^2)^2}</script><p>$\alpha_t$为切向量$t$方向的roughness，$\alpha_b$为副切向量$b$方向的roughness。</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Anisotropy</strong></td>
<td>Amount of anisotropy. Scalar[−1…1]</td>
</tr>
</tbody>
</table>
</div>
<p>各向异性一般由<strong>anistropy</strong>参数控制，Filament采用[<a href="https://google.github.io/filament/Filament.html#citation-kulla17" target="_blank" rel="noopener">Kulla17</a>]的方法参数化：</p>
<script type="math/tex; mode=display">
\alpha_t = \alpha \times (1 + \textbf{anisotropy}) \\
\alpha_b = \alpha \times (1 - \textbf{anisotropy})</script><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="keyword">float</span> at = max(roughness * (<span class="number">1.0</span> + anisotropy), <span class="number">0.001</span>);</span><br><span class="line"><span class="keyword">float</span> ab = max(roughness * (<span class="number">1.0</span> - anisotropy), <span class="number">0.001</span>);</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">V_SmithGGXCorrelated_Anisotropic</span><span class="params">(<span class="keyword">float</span> at, <span class="keyword">float</span> ab, <span class="keyword">float</span> ToV, <span class="keyword">float</span> BoV,</span></span></span><br><span class="line"><span class="function"><span class="params">        <span class="keyword">float</span> ToL, <span class="keyword">float</span> BoL, <span class="keyword">float</span> NoV, <span class="keyword">float</span> NoL)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));</span><br><span class="line">    <span class="keyword">float</span> lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));</span><br><span class="line">    <span class="keyword">float</span> v = <span class="number">0.5</span> / (lambdaV + lambdaL);</span><br><span class="line">    <span class="keyword">return</span> saturateMediump(v);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>[<a href="https://google.github.io/filament/Filament.html#citation-heitz14" target="_blank" rel="noopener">Heitz14</a>]提出了与height-correlated GGX相适配的$G$</p>
<script type="math/tex; mode=display">
\begin{equation}
V_{aniso}(n\cdot l,n\cdot v,\alpha) = \frac{1}{2((n\cdot l)\hat{\Lambda}_v+(n\cdot v)\hat{\Lambda}_l)} \\
\hat{\Lambda}_v = \sqrt{\alpha^2_t(t \cdot v)^2+\alpha^2_b(b \cdot v)^2+(n\cdot v)^2} \\
\hat{\Lambda}_l = \sqrt{\alpha^2_t(t \cdot l)^2+\alpha^2_b(b \cdot l)^2+(n\cdot l)^2}
\end{equation}</script><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">D_GGX_Anisotropic</span><span class="params">(<span class="keyword">float</span> NoH, <span class="keyword">const</span> vec3 h,</span></span></span><br><span class="line"><span class="function"><span class="params">    <span class="keyword">const</span> vec3 t, <span class="keyword">const</span> vec3 b, <span class="keyword">float</span> at, <span class="keyword">float</span> ab)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> ToH = dot(t, h);</span><br><span class="line">    <span class="keyword">float</span> BoH = dot(b, h);</span><br><span class="line">    <span class="keyword">float</span> a2 = at * ab;</span><br><span class="line">    highp vec3 v = vec3(ab * ToH, at * BoH, a2 * NoH);</span><br><span class="line">    highp <span class="keyword">float</span> v2 = dot(v, v);</span><br><span class="line">    <span class="keyword">float</span> w2 = a2 / v2;</span><br><span class="line">    <span class="keyword">return</span> a2 * w2 * w2 * (<span class="number">1.0</span> / PI);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="Subsurface-model"><a href="#Subsurface-model" class="headerlink" title="Subsurface model"></a>Subsurface model</h2><p>TODO</p>
<h2 id="Cloth-model"><a href="#Cloth-model" class="headerlink" title="Cloth model"></a>Cloth model</h2><p>与硬表面相比较，布料的反射探针更柔和，衰减更大，光照会有模糊的现象，这是由前向/后向散射造成的。</p>
<h3 id="Specular-BRDF"><a href="#Specular-BRDF" class="headerlink" title="Specular BRDF"></a>Specular BRDF</h3><p>[<a href="https://google.github.io/filament/Filament.html#citation-ashikhmin07" target="_blank" rel="noopener">Ashikhmin07</a>]使用逆高斯分布建模$D$</p>
<script type="math/tex; mode=display">D_{velvet}(v,h,\alpha) = c_{norm}(1 + 4 \exp\left(\frac{-{\cot}^2\theta_{h}}{\alpha^2}\right))</script><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">D_Ashikhmin</span><span class="params">(<span class="keyword">float</span> roughness, <span class="keyword">float</span> NoH)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// Ashikhmin 2007, "Distribution-based BRDFs"</span></span><br><span class="line">	<span class="keyword">float</span> a2 = roughness * roughness;</span><br><span class="line">	<span class="keyword">float</span> cos2h = NoH * NoH;</span><br><span class="line">	<span class="keyword">float</span> sin2h = max(<span class="number">1.0</span> - cos2h, <span class="number">0.0078125</span>); </span><br><span class="line">    <span class="comment">// 2^(-14/2), so sin2h^2 &gt; 0 in fp16</span></span><br><span class="line">	<span class="keyword">float</span> sin4h = sin2h * sin2h;</span><br><span class="line">	<span class="keyword">float</span> cot2 = -cos2h / (a2 * sin2h);</span><br><span class="line">	<span class="keyword">return</span> <span class="number">1.0</span> / (PI * (<span class="number">4.0</span> * a2 + <span class="number">1.0</span>) * sin4h) * (<span class="number">4.0</span> * \<span class="built_in">exp</span>(cot2) + sin4h);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>[<a href="https://google.github.io/filament/Filament.html#citation-neubelt13" target="_blank" rel="noopener">Neubelt13</a>]提供了一个归一化的版本</p>
<script type="math/tex; mode=display">D_{velvet}(v,h,\alpha) = \frac{1}{\pi(1 + 4\alpha^2)} (1 + 4\frac{\exp(\frac{-{\cot}^2\theta_h}{\alpha^2})}{ {sin}^4\theta_h})</script><p>[<a href="https://google.github.io/filament/Filament.html#citation-estevez17" target="_blank" rel="noopener">Estevez17</a>]提出了”Charlie sheen”，使用正弦的指数来建模，参数化更自然和符合直觉，效果更柔和。</p>
<script type="math/tex; mode=display">D(m) = \frac{(2 + \frac{1}{\alpha}) \sin^{\frac{1}{\alpha}}\theta_h}{2 \pi}</script><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function"><span class="keyword">float</span> <span class="title">D_Charlie</span><span class="params">(<span class="keyword">float</span> roughness, <span class="keyword">float</span> NoH)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"</span></span><br><span class="line">    <span class="keyword">float</span> invAlpha  = <span class="number">1.0</span> / roughness;</span><br><span class="line">    <span class="keyword">float</span> cos2h = NoH * NoH;</span><br><span class="line">    <span class="keyword">float</span> sin2h = max(<span class="number">1.0</span> - cos2h, <span class="number">0.0078125</span>); <span class="comment">// 2^(-14/2), so sin2h^2 &gt; 0 in fp16</span></span><br><span class="line">    <span class="keyword">return</span> (<span class="number">2.0</span> + invAlpha) * <span class="built_in">pow</span>(sin2h, invAlpha * <span class="number">0.5</span>) / (<span class="number">2.0</span> * PI);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>Filament使用了[<a href="https://google.github.io/filament/Filament.html#citation-estevez17" target="_blank" rel="noopener">Estevez17</a>]中的$f_r$</p>
<script type="math/tex; mode=display">f_{r}(v,h,\alpha) = \frac{D_{velvet}(v,h,\alpha)}{4(n\cdot l + n\cdot v - (n\cdot l)(n\cdot v))}</script><h3 id="Diffuse-BRDF-1"><a href="#Diffuse-BRDF-1" class="headerlink" title="Diffuse BRDF"></a>Diffuse BRDF</h3><p>布料模型的漫反射部分依然是Lambertian，但是为了加上一个可选的次表面散射项，漫反射部分需要稍加修改来保证能量守恒。这个额外项不是基于物理的，可用于模拟某些布料中光的散射、部分吸收和再发射。</p>
<p>基本的漫反射项为</p>
<script type="math/tex; mode=display">f_{d}(v,h) = \frac{c_{diff}}{\pi}(1 - F(v,h))</script><p>$1 - F(v,h)$在漫反射中效果微弱，一般忽略。</p>
<p>次表面散射是使用the wrapped diffuse lighting实现的，其能量守恒形式：</p>
<script type="math/tex; mode=display">f_{d}(v,h) = \frac{c_{diff}}{\pi}(1 - F(v,h)) \left< n\cdot l + \frac{w}{(1 + w)^2} \right> \left< c_{subsurface} + n\cdot l \right></script><p>其中$\left&lt;\cdot\right&gt;$表示clamp。$w$是一个介于0和1之间的值，定义漫射光wrap的程度。为了避免引入另一个参数，我们固定$w=0.5$。请注意，对于wrapped diffuse lighting，漫反射项不得乘以$n\cdot l$。</p>
<h3 id="Parameterization-1"><a href="#Parameterization-1" class="headerlink" title="Parameterization"></a>Parameterization</h3><p>布料模型基本延续标准模型的参数，只是去掉了<strong>metallic</strong>和<strong>reflectance</strong>。新增的参数如下</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Definition</th>
<th>Type&amp;Range</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>sheenColor</strong></td>
<td>Specular tint to create two-tone specular fabrics (defaults to $\sqrt{\textbf{baseColor}}$)</td>
<td>Float3 [0…1]</td>
</tr>
<tr>
<td><strong>subsurfaceColor</strong></td>
<td>Tint for the diffuse color after scattering and absorption through the material</td>
<td>Float3 [0…1]</td>
</tr>
</tbody>
</table>
</div>
<h3 id="Summary-1"><a href="#Summary-1" class="headerlink" title="Summary"></a>Summary</h3><p>完整的布料BRDF代码如下<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="comment">// specular BRDF</span></span><br><span class="line"><span class="keyword">float</span> D = distributionCloth(roughness, NoH);</span><br><span class="line"><span class="keyword">float</span> V = visibilityCloth(NoV, NoL);</span><br><span class="line">vec3  F = sheenColor;</span><br><span class="line">vec3 Fr = (D * V) * F;</span><br><span class="line"></span><br><span class="line"><span class="comment">// diffuse BRDF</span></span><br><span class="line"><span class="keyword">float</span> diffuse = diffuse(roughness, NoV, NoL, LoH);</span><br><span class="line"><span class="meta">#<span class="meta-keyword">if</span> defined(MATERIAL_HAS_SUBSURFACE_COLOR)</span></span><br><span class="line"><span class="comment">// energy conservative wrap diffuse</span></span><br><span class="line">diffuse *= saturate((dot(n, light.l) + <span class="number">0.5</span>) / <span class="number">2.25</span>);</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span></span></span><br><span class="line">vec3 Fd = diffuse * pixel.diffuseColor;</span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">if</span> defined(MATERIAL_HAS_SUBSURFACE_COLOR)</span></span><br><span class="line"><span class="comment">// cheap subsurface scatter</span></span><br><span class="line">Fd *= saturate(subsurfaceColor + NoL);</span><br><span class="line">vec3 color = Fd + Fr * NoL;</span><br><span class="line">color *= (lightIntensity * lightAttenuation) * lightColor;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">else</span></span></span><br><span class="line">vec3 color = Fd + Fr;</span><br><span class="line">color *= (lightIntensity * lightAttenuation * NoL) * lightColor;</span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span></span></span><br></pre></td></tr></table></figure></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/CG/" rel="tag"># CG</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2022/04/21/Multiple-Importance-Sampling/" rel="next" title="Multiple Importance Sampling">
                <i class="fa fa-chevron-left"></i> Multiple Importance Sampling
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2022/05/01/Spherical-Harmonics/" rel="prev" title="Spherical Harmonics">
                Spherical Harmonics <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/MOB.jpg" alt="HTelepathH">
            
              <p class="site-author-name" itemprop="name">HTelepathH</p>
              <p class="site-description motion-element" itemprop="description">Learning by doing.</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="99088577@qq.com" target="_blank" title="Mail">
                      Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/htelepathh" target="_blank" title="Gitee">
                      Gitee</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/htlpt" target="_blank" title="GitHub">
                      GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/6207125886" target="_blank" title="微博">
                      微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/huang-he-tu" target="_blank" title="知乎">
                      知乎</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Standard-model"><span class="nav-number">1.</span> <span class="nav-text">Standard model</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Specular-BRDF-Cook-Torrance-Approximation"><span class="nav-number">1.1.</span> <span class="nav-text">Specular BRDF : Cook-Torrance Approximation</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Diffuse-BRDF"><span class="nav-number">1.2.</span> <span class="nav-text">Diffuse BRDF</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Lambertian"><span class="nav-number">1.2.1.</span> <span class="nav-text">Lambertian</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Disney"><span class="nav-number">1.2.2.</span> <span class="nav-text">Disney</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Energy-Loss"><span class="nav-number">1.3.</span> <span class="nav-text">Energy Loss</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Kulla-Conty"><span class="nav-number">1.3.1.</span> <span class="nav-text">Kulla-Conty</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Lagarde"><span class="nav-number">1.3.2.</span> <span class="nav-text">Lagarde</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Summary"><span class="nav-number">1.4.</span> <span class="nav-text">Summary</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Parameterization"><span class="nav-number">2.</span> <span class="nav-text">Parameterization</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#remapping"><span class="nav-number">2.1.</span> <span class="nav-text">remapping</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Crafting-Filament-PBM"><span class="nav-number">2.2.</span> <span class="nav-text">Crafting Filament PBM</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Clear-coat-model"><span class="nav-number">2.3.</span> <span class="nav-text">Clear coat model</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Anisotropic-model"><span class="nav-number">3.</span> <span class="nav-text">Anisotropic model</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Subsurface-model"><span class="nav-number">4.</span> <span class="nav-text">Subsurface model</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Cloth-model"><span class="nav-number">5.</span> <span class="nav-text">Cloth model</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Specular-BRDF"><span class="nav-number">5.1.</span> <span class="nav-text">Specular BRDF</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Diffuse-BRDF-1"><span class="nav-number">5.2.</span> <span class="nav-text">Diffuse BRDF</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Parameterization-1"><span class="nav-number">5.3.</span> <span class="nav-text">Parameterization</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Summary-1"><span class="nav-number">5.4.</span> <span class="nav-text">Summary</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-angle-double-left"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HTelepathH</span>

  
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          displayMath: [ ['$$', '$$']],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>
